home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / SVRAPI.H < prev    next >
C/C++ Source or Header  |  1997-02-13  |  47KB  |  1,322 lines

  1. /********************************************************************/
  2. /**                     Microsoft Windows                          **/
  3. /**               Copyright(c) Microsoft Corp., 1995               **/
  4. /********************************************************************/
  5.  
  6. /********************************************************************
  7.  *                                                                  *
  8.  *  About this file ...  SVRAPI.H                                   *
  9.  *                                                                  *
  10.  *  This file contains information about the NetAccess,             *
  11.  *  NetConnection, NetFile, NetServer, NetSession, NetShare and     *
  12.  *  NetSecurity APIs.                                               *
  13.  *  There is a section for each set of APIs.                        *
  14.  *  Each section contains:                                          *
  15.  *                                                                  *
  16.  *      Function prototypes.                                        *
  17.  *                                                                  *
  18.  *      Data structure templates.                                   *
  19.  *                                                                  *
  20.  *      Definition of special values.                               *
  21.  *                                                                  *
  22.  *      Description of level of Win95 peer server support           *
  23.  *
  24.  *  For background information refer to the Lan Manager Programmer's
  25.  *  Reference.
  26.  *
  27.  *  WARNING:
  28.  *      The APIs documented herein are not guaranteed to be supported
  29.  * in future versions of Windows. Their primary purpose is to       *
  30.  * administer Win95 peer servers.                                   *
  31.  *                                                                  *
  32.  ********************************************************************/
  33.  
  34. /*
  35.  *      NOTE:  Lengths of ASCIIZ strings are given as the maximum
  36.  *      strlen() value.  This does not include space for the
  37.  *      terminating 0-byte.  When allocating space for such an item,
  38.  *      use the form:
  39.  *
  40.  *              char username[LM20_UNLEN+1];
  41.  *
  42.  *      An exception to this is the PATHLEN manifest, which does
  43.  *      include space for the terminating 0-byte.
  44.  *
  45.  *      User names, computer names and share names should be
  46.  *      upper-cased by the caller and drawn from the ANSI 
  47.  *      character set.
  48.  * 
  49.  */
  50.  
  51. /*NOINC*/
  52. #ifndef SVRAPI_INCLUDED
  53. #define SVRAPI_INCLUDED
  54. #pragma option -b
  55.  
  56. #pragma option -b.
  57. #include <lmcons.h>
  58. #pragma option -b
  59. #pragma option -b.
  60. #include <lmerr.h>
  61. #pragma option -b
  62.  
  63. #ifndef RC_INVOKED
  64. #pragma pack(1)         /* Assume byte packing throughout */
  65. #endif
  66.  
  67. #ifdef __cplusplus
  68. extern "C" {            /* Assume C declarations for C++ */
  69. #endif    /* __cplusplus */
  70.  
  71. #if !defined(_SVRAPI_)
  72. #define API_FUNCTION DECLSPEC_IMPORT API_RET_TYPE APIENTRY
  73. #else
  74. #define API_FUNCTION API_RET_TYPE APIENTRY
  75. #endif
  76.  
  77. /*INC*/
  78.  
  79.  
  80. /****************************************************************
  81.  *                                                              *
  82.  *                 Access Class                                 *
  83.  *                                                              *
  84.  ****************************************************************/
  85.  
  86.  
  87. /****************************************************************
  88.  *                                                              *
  89.  *                  Function prototypes - ACCESS                *
  90.  *
  91.  *     Requires User level security to be enabled
  92.  *                                                              *
  93.  *    Peer Server Support:
  94.  *      Remote support of these APIs on NWSERVER is limited as
  95.  *      described below:
  96.  *
  97.  *        NetAccessAdd -
  98.  *                local and remote VSERVER - level 2
  99.  *              remote NWSERVER -          level 2
  100.  *        NetAccessCheck - local only
  101.  *      NetAccessDel - 
  102.  *              local, remote NWSERVER and remote VSERVER
  103.  *      NetAccessEnum -
  104.  *              sLevel 0 on remote NWSERVER (fRecursive = 1),
  105.  *              slevel 0, 1, 2 on local and remote VSERVER
  106.  *        NetAccessGetInfo -
  107.  *               all sLevels on local and remote VSERVER,
  108.  *               sLevel 0, 12 on remote NWSERVER
  109.  *      NetAccessSetInfo - 
  110.  *              sLevel 1, 12 on local and remote VSERVER,
  111.  *              sLevel 12 on remote NWSERVER
  112.  *              parmnum = PARMNUM_ALL only
  113.  *      NetAccessGetUserPerms - local and remote VSERVER only
  114.  ****************************************************************/
  115.  
  116. extern API_FUNCTION
  117.   NetAccessAdd ( const char FAR * pszServer,
  118.                  short            sLevel,
  119.                  char FAR *       pbBuffer,
  120.                  unsigned short   cbBuffer );
  121.  
  122. extern API_FUNCTION
  123.   NetAccessCheck ( char FAR *           pszReserved,
  124.                    char FAR *           pszUserName,
  125.                    char FAR *           pszResource,
  126.                    unsigned short       usOperation,
  127.                    unsigned short FAR * pusResult );
  128.  
  129. extern API_FUNCTION
  130.   NetAccessDel ( const char FAR * pszServer,
  131.                  char FAR *       pszResource );
  132.  
  133. extern API_FUNCTION
  134.   NetAccessEnum ( const char FAR *     pszServer,
  135.                   char FAR *           pszBasePath,
  136.                   short                fsRecursive,
  137.                   short                sLevel,
  138.                   char FAR *           pbBuffer,
  139.                   unsigned short       cbBuffer,
  140.                   unsigned short FAR * pcEntriesRead,
  141.                   unsigned short FAR * pcTotalAvail );
  142.  
  143. extern API_FUNCTION
  144.   NetAccessGetInfo ( const char FAR *     pszServer,
  145.                      char FAR *           pszResource,
  146.                      short                sLevel,
  147.                      char FAR *           pbBuffer,
  148.                      unsigned short       cbBuffer,
  149.                      unsigned short FAR * pcbTotalAvail );
  150.  
  151. extern API_FUNCTION
  152.   NetAccessSetInfo ( const char FAR * pszServer,
  153.                      char FAR *       pszResource,
  154.                      short            sLevel,
  155.                      char FAR *       pbBuffer,
  156.                      unsigned short   cbBuffer,
  157.                      short            sParmNum );
  158.  
  159. extern API_FUNCTION
  160.   NetAccessGetUserPerms ( char FAR *           pszServer,
  161.                           char FAR *           pszUgName,
  162.                           char FAR *           pszResource,
  163.                           unsigned short FAR * pusPerms );
  164.  
  165.  
  166. /****************************************************************
  167.  *                                                              *
  168.  *              Data structure templates - ACCESS               *
  169.  *                                                              *
  170.  ****************************************************************/
  171.  
  172. struct access_list {
  173.         char            acl_ugname[LM20_UNLEN+1];
  174.         char            acl_ugname_pad_1;
  175.         short           acl_access;
  176. };      /* access_list */
  177.  
  178. struct access_list_2
  179. {
  180.         char FAR *      acl2_ugname;
  181.         unsigned short  acl2_access;
  182. };      /* access_list_2 */
  183.              
  184. struct access_list_12
  185. {
  186.         char FAR *      acl12_ugname;
  187.         unsigned short  acl12_access;
  188. };      /* access_list_12 */
  189.              
  190. struct access_info_0 {
  191.         char FAR *      acc0_resource_name;
  192. };      /* access_info_0 */
  193.  
  194. struct access_info_1 {
  195.         char  FAR *     acc1_resource_name;
  196.         short           acc1_attr;                      /* See values below */
  197.         short           acc1_count;
  198. };      /* access_info_1 */
  199.  
  200. struct access_info_2 
  201. {
  202.         char  FAR *     acc2_resource_name;
  203.         short           acc2_attr;
  204.         short           acc2_count;
  205. };      /* access_info_2 */
  206.  
  207. struct access_info_10 {
  208.         char FAR *      acc10_resource_name;
  209. };      /* access_info_10 */
  210.  
  211. struct access_info_12 
  212. {
  213.         char  FAR *     acc12_resource_name;
  214.         short           acc12_attr;
  215.